/**
*  \file parameter.h
*
*  \brief
*
*  \author   <@linde-mh.de>
*
*
*/

#ifndef PARAMETER_H_INCLUDED
#define PARAMETER_H_INCLUDED

#ifndef PARAMETER_LINKAGE
#define PARAMETER_LINKAGE extern
#endif

/*================================================[ public includes  ]================================================*/
#include "../cfg/prj.h"

/*================================================[ public defines   ]================================================*/


/*================================================[ public datatypes ]================================================*/
struct parameter
{
   CH *hex_file_name;

   /* [can] */
	U32 can_baud;
	BO  can_baud_valid;

	/* [kwp] */
	U32 kwp_tx_id;
	BO  kwp_tx_id_valid;

	U32 kwp_rx_id;
	BO  kwp_rx_id_valid;

	U32 kwp_common_id;
	BO  kwp_common_id_valid;

	U32 init_01_tx_id;
	BO  init_01_tx_id_valid;

	U32 init_01_rx_id;
	BO  init_01_rx_id_valid;

   U32 hwid_tx_id;
   BO  hwid_tx_id_valid;

   U32 hwid_rx_id;
   BO  hwid_rx_id_valid;

	/* [options] */
	BO  emergency_start;
	BO  emergency_start_valid;

	BO  automatic_detection;
	BO  automatic_detection_valid;

	U32 emergency_duration;
	U32 emergency_duration_valid;

   U32 address_size;
   U32 address_size_valid;

   BO  use_manual_separation_time;
   BO  use_manual_separation_time_valid;

   U32 manual_separation_time;
   BO  manual_separation_time_valid;

   BO  reset_after_programming;
   BO  reset_after_programming_valid;

	BO  wait_before_exit;
	BO  wait_before_exit_valid;

	/* [filling] */
   U8  fillbyte;
   BO  fillbyte_valid;

   CH *segfile;
   BO  segfile_valid;

   BO  fill_only_hexfile;
   BO  fill_only_hexfile_valid;

	/* [security] */
	CH  hex_checksum[33];
	BO  hex_checksum_valid;

	CH  seg_checksum[33];
	BO  seg_checksum_valid;

   CH* check_hwid;
   BO  check_hwid_valid;

	/*[can-cards] */
	CH *cancard_name[0x100];
	U32 cancard_serial_numbers[0x100];
	BO  cancard_serial_numbers_valid[0x100];
};

/*================================================[ public variables ]================================================*/
extern struct parameter parameter;

/*================================================[ public functions ]================================================*/
RC parameter_initialize( U32 argc, CH *argv[] );
void * parameter_test_serial_number(U32 serial );

/*====================================================================================================================*/


#endif

/***********************************************************************************************************************
*                             Copyright 2010 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/
